/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author rafrau
 */
@Entity
@Table(name = "usu", catalog = "idlbbd", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Usu.findAll", query = "SELECT u FROM Usu u"),
    @NamedQuery(name = "Usu.findByIdUsu", query = "SELECT u FROM Usu u WHERE u.idUsu = :idUsu"),
    @NamedQuery(name = "Usu.findByNusrUsu", query = "SELECT u FROM Usu u WHERE u.nusrUsu = :nusrUsu"),
    @NamedQuery(name = "Usu.findByPssUsu", query = "SELECT u FROM Usu u WHERE u.pssUsu = :pssUsu"),
    @NamedQuery(name = "Usu.findByEmailUsu", query = "SELECT u FROM Usu u WHERE u.emailUsu = :emailUsu")})
public class Usu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "id_usu", nullable = false)
    private int idUsu;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nusr_usu", nullable = false, length = 50)
    private String nusrUsu;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "pss_usu", nullable = false, length = 50)
    private String pssUsu;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "email_usu", nullable = false, length = 50)
    private String emailUsu;

    public Usu() {
    }

    public Usu(String nusrUsu) {
        this.nusrUsu = nusrUsu;
    }

    public Usu(String nusrUsu, int idUsu, String pssUsu, String emailUsu) {
        this.nusrUsu = nusrUsu;
        this.idUsu = idUsu;
        this.pssUsu = pssUsu;
        this.emailUsu = emailUsu;
    }

    public int getIdUsu() {
        return idUsu;
    }

    public void setIdUsu(int idUsu) {
        this.idUsu = idUsu;
    }

    public String getNusrUsu() {
        return nusrUsu;
    }

    public void setNusrUsu(String nusrUsu) {
        this.nusrUsu = nusrUsu;
    }

    public String getPssUsu() {
        return pssUsu;
    }

    public void setPssUsu(String pssUsu) {
        this.pssUsu = pssUsu;
    }

    public String getEmailUsu() {
        return emailUsu;
    }

    public void setEmailUsu(String emailUsu) {
        this.emailUsu = emailUsu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nusrUsu != null ? nusrUsu.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usu)) {
            return false;
        }
        Usu other = (Usu) object;
        if ((this.nusrUsu == null && other.nusrUsu != null) || (this.nusrUsu != null && !this.nusrUsu.equals(other.nusrUsu))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Usu[ nusrUsu=" + nusrUsu + " ]";
    }
    
}
